package com.txMsg.server;

import com.txMsg.server.config.TxMsgConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@RestController
@MapperScan("com.txMsg.server.dao")
@EnableEurekaClient
@EnableAspectJAutoProxy(exposeProxy=true)
@EnableDiscoveryClient
@EnableFeignClients
public class TxMsgServerApplication {

	public static void main(String[] args) {
		SpringApplication.run(TxMsgServerApplication.class, args);
	}
	@Bean
	@LoadBalanced
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}

	@Autowired
	private RestTemplate restTemplate;
	@Autowired
	private TxMsgConfig txMsgConfig;

	@RequestMapping("data")
	public Object data(){
		System.out.println(txMsgConfig);
		return "xxxxx";
	}

}
